package cn.imnaer.service.rest.resquest.model;

import cn.imnaer.common.factory.JacksonUtil;
import cn.imnaer.service.persistence.model.Schedule;

/**
 * @author Administrator
 *         <p/>
 *         收藏转换成行程的参数
 */
public class ScheduleCreateParams {
    private String scheduleName;
    private String cityName;
    private String userId;
    private String type;      //
    private String id;    //scenicId或者travelNoteScenic的id

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getScheduleName() {
        return scheduleName;
    }

    public void setScheduleName(String scheduleName) {
        this.scheduleName = scheduleName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Schedule transformSchedule() {
        Schedule schedule = new Schedule();
        schedule.setScheduleName(scheduleName);
        schedule.setUserId(userId);
        schedule.setCityName(this.cityName);
        return schedule;

    }

    public static ScheduleCreateParams parserToModel(String scheduleCreateParamsJson) {
        return (ScheduleCreateParams) JacksonUtil.jsonToBean(scheduleCreateParamsJson, ScheduleCreateParams.class);
    }


}
